rotate_list = ['0','1',' ',' ',' ',' ','9',' ','8','6']
n = input()
mirrorn = n[::-1]
rotaten = ''.join([rotate_list[int(ch)] for ch in mirrorn])
out = "Yes" if rotaten == n else "No"
print(out)